package com.example.mywechatprogram.controller;

import com.example.mywechatprogram.entity.Response;
import com.example.mywechatprogram.entity.Word;
import com.example.mywechatprogram.mapper.WordMapper;

import com.example.mywechatprogram.service.CustomService;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CustomController {
    @Autowired
    CustomService customService;
    @PostMapping("/Custom/add")
    public Response add(int word_id,String word,String userId){
        return customService.add(word_id,word,userId);
    }
    @GetMapping("/Custom/request")
    public Response request(String userId){
        return customService.request(userId);
    }

    @PostMapping("/Custom/del")
    public Response delCustom(String userId,int word_id){
        return customService.delCustom(userId,word_id);
    }
}
